﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Lohnefink3D
{
    class CameraManager
    {
        public static List<Camera> cameras = new List<Camera>();
        public static Camera currentCamera;

        public CameraManager()
        {

        }

        private Camera getNextCamera()
        {
            for (int i = 0; i < cameras.Count; i++)
            {
                if (cameras[i].Equals(currentCamera))
                {
                    if (i < (cameras.Count - 1))
                    {
                        return cameras[i + 1];
                    }
                    else
                    {
                        return cameras[0];
                    }
                }
            }
            return cameras[0];
        }

        public void Update(KeyboardState keyboard)
        {
            if (keyboard.IsKeyDown(Keys.Tab))
            {
                currentCamera = getNextCamera();
            }
        }
    }
}
